package com.sky.mapper;

import com.sky.entity.ShoppingCart;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {

    List<ShoppingCart> list(ShoppingCart kk);

    void updateNumberByID(ShoppingCart kk);

    void addToCart(ShoppingCart kk);


    List<ShoppingCart> getCartlist(Long userId);

    @Delete("delete from shopping_cart where user_id = #{userId}")
    void cleanAllCart(Long userId);

    void subOne(ShoppingCart kk);

    void deleteByUserId(Long userId);

    void insertBatch(List<ShoppingCart> shoppingCartList);
}
